package com.info.zhiduoduo.repository.mapper.system;

import com.baomidou.mybatisplus.mapper.BaseMapper;
import com.info.zhiduoduo.repository.dto.system.SystemDictDto;
import com.info.zhiduoduo.repository.entity.system.SystemDict;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 *  的 字典表
 */
public interface SystemDictMapper extends BaseMapper<SystemDict> {


    /**
     * 根据 字典类型 获取 数据
     * @param type
     * @return
     */
    @Select(" select id , dict_name from zdd_system_dict where dict_type = #{type} and dict_state = 0 ")
    List<SystemDictDto> queryServeTypeList(int type);

    @Select("SELECT dict_name FROM zdd_system_dict WHERE id = #{id}")
    String queryDictName(int id);

}
